home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-05-25 | 4.0 KB | 152 lines | [TEXT/MACA] |
- ; File Section Maintenance Script
- ; written by Pete Johnson
- ; for the Glassell Park BBS
- ; (213) 258-7649
- ;
- ; Define path to prefix filesecs
- ;
- DEFINE "GP" "Glass:BBS:Files"
- ;
- ; The Glassell Park BBS is set up with all files in the following
- ; path -- Glass:BBS:Files: -- followed by a specific file folder.
- ; Each file folder is named for its contents -- Comm, Fonts, Text etc.
- ; If we're in the Comm: folder, we'll see three file directories:
- ; *New, *Comm and *Comm.c
- ; Uploads go to *New. *Comm contains an alphabetically sorted list of
- ; files. *Comm.c contains the same list of files, sorted new -> old.
- ; Each file section is loaded (using alpha-sort version)...
- ; its filepath is reset...
- ; it's sorted by date (in new -> old order)...
- ; and the result is written to the file section with a ".c" suffix...
- ; then it's sorted by filename...
- ; and the result overwrites the original file section.
- ;
- ; But first we'll purge deleted file entries from the private
- ; and new sections, if in non-remote mode. In the process, we kill
- ; any files which have been deleted in the *New directory but which
- ; haven't been moved into the corresponding download directory (clean
- ; up for garbage uploads).
- ;
- ;
- DEFINEMACRO "Clean"
- CONCATENATE "@3" "GP:" "@1" ; i.e. Glass:BBS:Files:DeskAcc
- CONCATENATE "@3" "@3:*" "@1" ; i.e. Glass:BBS:Files:DeskAcc:*DeskAcc
- CONCATENATE "@1" "GP:" "@1" ; i.e. Glass:BBS:Files:DeskAcc
- CONCATENATE "@1" "@1:" "@2" ; i.e. Glass:BBS:Files:DeskAcc:*New
- LOAD "@1"
- SUBTRACT "@3" ; Eliminate *New entries which have moved
- PURGE/DELETE ; and kill remaining entries marked deleted.
- CHECK/PATH
- PURGE
- SAVE "@1"
- ENDMACRO
- ;
- Clean "Business" "*New"
- Clean "Comm" "*New"
- Clean "DeskAcc" "*New"
- Clean "Fonts" "*New"
- Clean "Games" "*New"
- Clean "Graph" "*New"
- Clean "Music" "*New"
- Clean "Text" "*New"
- Clean "Utility" "*New"
- ;
- ; Special macro for private directories.
- ;
- DEFINEMACRO "Private"
- CONCATENATE "@2" "GP:" "@1"
- CONCATENATE "@2" "@2:*" "@1"
- LOAD "@2"
- PURGE/DELETE
- CHECK/PATH
- PURGE
- SAVE "@2"
- ENDMACRO
- ;
- Private "Private"
- Private "Valley"
- ;
- ; The *Best directory is a bit different, so it gets its own routine.
- ;
- CONCATENATE "@1" "GP:" "*Best"
- LOAD "@1"
- CHECK/PATH
- PURGE
- SORT/DATE
- SAVE "@1.c"
- SORT/TITLE
- SAVE "@1"
- ;
- ; If we're not in remote mode, we also delete files referenced by deleted
- ; FileSection entries, check for valid paths on every entry and purge the
- ; entries marked for deletion. This is not done via remote, because it
- ; takes too much time.
- ;
- DEFINEMACRO "Shuffle"
- CONCATENATE "@2" "GP:" "@1:" ; i.e. GP:Comm:
- CONCATENATE "@3" "@2*" "@1" ; i.e. GP:Comm:*Comm
- LOAD "@3"
- SETPATH "@2"
- SKIP "#3" "Remote"
- PURGE/DELETE
- CHECK/PATH
- PURGE
- SORT/DATE
- SAVE "@3.c"
- SORT/TITLE
- SAVE "@3"
- ENDMACRO
- ;
- Shuffle "Business"
- Shuffle "Comm"
- Shuffle "DeskAcc"
- Shuffle "Fonts"
- Shuffle "Games"
- Shuffle "Graph"
- Shuffle "Music"
- Shuffle "Text"
- Shuffle "Utility"
- ;
- ; Now we want to make an aggregate file containing all the sections.
- ; We already have the Utility section sorted alphabetically in memory.
- ;
- ; We add all other sections, also sorted alphabetically...
- ;
- ; Then get a path list to compare for maintenance.
- ; Then we sort the whole thing alphabetically by filename...
- ; and write the result into a master directory...
- ; and a textfile.
- ;
- DEFINEMACRO "Collect"
- CONCATENATE "@2" "GP:" "@1:*" ; i.e. GP:Comm:*
- CONCATENATE "@2" "@2" "@1" ; i.e. GP:Comm:*Comm
- ADD "@2"
- ENDMACRO
- ;
- Collect "Text"
- Collect "Music"
- Collect "Graph"
- Collect "Games"
- Collect "Fonts"
- Collect "DeskAcc"
- Collect "Comm"
- Collect "Business"
- ;
- SAVETEXT/PATH "GP:*All.path" ; for board maintenance
- ;
- ; The next line adds listing of All Files to downloads, so callers can
- ; download directory contents. It's a FileSection with one entry
- ; pointing to the *All.txt file we're about to make. I made the entry
- ; with a future date, so it shows at the top of both the chronological
- ; and alphabetical *All file lists.
- ;
- ADD "GP:*Misc"
- SORT/TITLE
- SAVE "GP:*All"
- SAVETEXT/DESC "GP:*All.txt"
- SORT/DATE
- SAVE "GP:*All.c"
- ;
- LAUNCH "Host" "Remote"
- END
-